package com.dfbz.demo08_super关键字;

/**
 * @author lscl
 * @version 1.0
 * @intro:
 */
public class Demo01 {
    public static void main(String[] args) {

        Zi zi = new Zi();

//        zi.show();

        zi.method();

    }
}

class Fu {

    int aaa = 10;

    public void method() {
        System.out.println("fu method...");
    }
}

class Zi extends Fu {

    int aaa = 100;


    public void method() {

        // 通过super调用父类的方法(保留原有功能)
        super.method();
        System.out.println("zi method...");
    }


    public void show() {

        // 通过super可以获取父类的成员变量
        System.out.println("Fu的aaa: " + super.aaa);
        System.out.println("zi的aaa: " + aaa);
    }


}
